package apka.SMSBillet.Activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import apka.SMSBillet.R;
import apka.SMSBillet.R.id;
import apka.SMSBillet.R.layout;
import apka.SMSBillet.R.string;

public class MainMenu extends Activity{
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_menu);
        
        ListView menuList = (ListView) findViewById(R.id.ListView_Menu);
        
        String[] menuItems = {	getResources().getString(R.string.Menu1),
				        		getResources().getString(R.string.Menu2),
				        		getResources().getString(R.string.Menu3)};
        
        ArrayAdapter<String> adapt = new ArrayAdapter<String>(this, R.layout.menu_item, menuItems);
        menuList.setAdapter(adapt);
        
        menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View itemClicked, int position,
					long id) {
				TextView textView = (TextView) itemClicked;
				String strText = textView.getText().toString();
				if(strText.equalsIgnoreCase(getResources().getString(R.string.Menu1))){
					startActivity(new Intent(MainMenu.this, FindTravel.class));
				}
				
			}
        	
		});
        
        }
	}



